/*
package com.controll;

import com.util.EmailUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/register")
public class RegisterServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();

        String email = request.getParameter("email");
        if (EmailUtil.validateEmail(email)) {
            if (EmailUtil.sendVerificationEmail(email)) {
                out.println("注册成功，请前往邮箱查收验证邮件并完成验证。");
            } else {
                out.println("邮件发送失败，请稍后再试。");
            }
        } else {
            out.println("邮箱格式不正确，请重新输入。");
        }
    }
}
*/
